package com.mocha.common.core.auth;

import com.alibaba.fastjson.JSON;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: songkui
 * @date: 2023/4/3 10:53
 */
public class SensitiveBuilder {
    //public static void main(String[] args) {
    //   test();
    //}

    public static void test(){
        SensitiveBO sensitiveBO = new SensitiveBO();
        sensitiveBO.setCname("SupplierEntity");
        sensitiveBO.setCtitle("供应商");
        buildSupplierField(sensitiveBO);

        String json = JSON.toJSONString(sensitiveBO);
        System.out.println(json);
    }

    public static void buildSupplierField(SensitiveBO sensitiveBO){
        List<SensitiveFieldBO> list = new ArrayList<>();
        list.add(new SensitiveFieldBO("price",   SensitiveType.Price.name()));
        list.add(new SensitiveFieldBO("contactDetails", SensitiveType.Link.name()));
        sensitiveBO.setFieldList(list);
    }

    public static void buildOrderField(SensitiveBO sensitiveBO){
        List<SensitiveFieldBO> list = new ArrayList<>();
        list.add(new SensitiveFieldBO("price",   SensitiveType.Price.name()));
        list.add(new SensitiveFieldBO("link", SensitiveType.Link.name()));
        sensitiveBO.setFieldList(list);
    }


}
